#!/bin/bash
. ./cmd.sh
. ./path.sh

for speaker in `cat data/test/spk2gender | awk '{print $1}' | sed ':a;N;$!ba;s/\n/ /g'`; do

echo $speaker

ali-to-phones exp_pdnn/${speaker}_ali/final.mdl "ark:gunzip -c exp_pdnn/${speaker}_ali/ali.*.gz |" ark:- | analyze-counts --binary=false ark:- phone_distribution/$speaker.counts
done

exit 0

for x in $speakers; do
working_dir=data/test/$x
echo $working_dir

if [ ! -f $working_dir/train.pfile.done ]; then
  steps_pdnn/build_nnet_pfile.sh --cmd "$train_cmd" --every-nth-frame 1 --norm-vars true --do-split true --pfile-unit-size 5 --cv-ratio 0.05 --splice-opts "--left-context=5 --right-context=5" --input-dim 440 $working_dir ${gmmdir}_ali $working_dir
  ( cd $working_dir; rm concat.pfile; )
  touch $working_dir/train.pfile.done
fi
done
